#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 25;
const int MOD = 1e9 + 7;

ll n, m, a[N];
ll inv[N];
void init(ll n) {
  inv[1] = 1;
  rep(i, 2, n) {
    ll x = MOD / i, r = MOD % i;
    // x * i + r = MOD
    // x * inv[r] + inv[i] = 0
    // inv[i] = MOD - x * inv[r] % MOD;
    inv[i] = (MOD - x * inv[r] % MOD) % MOD;
  }
}
ll C(ll n, ll m) {
  if (n < 0 || m < 0 || n < m) return 0;
  ll ans = 1;
  rep(i, 0, m - 1) ans = (n - i) % MOD * ans % MOD;
  rep(i, 1, m) ans = ans * inv[i] % MOD;
  return ans;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  init(20);
  cin >> n >> m;
  rep(i, 0, n - 1) cin >> a[i];
  int mx = (1 << n) - 1;
  ll ans = 0;
  rep(i, 0, mx) {
    int k = __builtin_popcount(i);
    ll x = 0;
    rep(j, 0, n - 1) {
      if (i & (1 << j)) {
        x += a[j] + 1;
      }
    }
    ll y = C(n - 1 + m - x, n - 1);
    if (k & 1)
      ans = (ans + MOD - y) % MOD;
    else
      ans = (ans + y) % MOD;
  }
  cout << ans;
  return 0;
}